/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "Task")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Task.findAll", query = "SELECT t FROM Task t"),
    @NamedQuery(name = "Task.findByTaskID", query = "SELECT t FROM Task t WHERE t.taskID = :taskID"),
    @NamedQuery(name = "Task.findByTaskDesc", query = "SELECT t FROM Task t WHERE t.taskDesc = :taskDesc"),
    @NamedQuery(name = "Task.findByDueDate", query = "SELECT t FROM Task t WHERE t.dueDate = :dueDate"),
    @NamedQuery(name = "Task.findByDueTime", query = "SELECT t FROM Task t WHERE t.dueTime = :dueTime"),
    @NamedQuery(name = "Task.findByHighPriority", query = "SELECT t FROM Task t WHERE t.highPriority = :highPriority"),
    @NamedQuery(name = "Task.findByTaskDeptID", query = "SELECT t FROM Task t WHERE t.taskDeptID = :taskDeptID"),
    @NamedQuery(name = "Task.findByFinEID", query = "SELECT t FROM Task t WHERE t.finEID = :finEID"),
    @NamedQuery(name = "Task.findByFinishDate", query = "SELECT t FROM Task t WHERE t.finishDate = :finishDate"),
    @NamedQuery(name = "Task.findByFinishTime", query = "SELECT t FROM Task t WHERE t.finishTime = :finishTime"),
    @NamedQuery(name = "Task.findByTaskType", query = "SELECT t FROM Task t WHERE t.taskType = :taskType"),
    @NamedQuery(name = "Task.findByBatchID", query = "SELECT t FROM Task t WHERE t.batchID = :batchID"),
    @NamedQuery(name = "Task.findOpenTasks", query = "SELECT t FROM Task t WHERE t.finEID = 0")})
public class Task implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "TaskID")
    private Integer taskID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 250)
    @Column(name = "TaskDesc")
    private String taskDesc;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DueDate")
    @Temporal(TemporalType.DATE)
    private Date dueDate;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DueTime")
    @Temporal(TemporalType.TIME)
    private Date dueTime;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HighPriority")
    private boolean highPriority;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TaskDeptID")
    private int taskDeptID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "FinEID")
    private int finEID;
    @Column(name = "FinishDate")
    @Temporal(TemporalType.DATE)
    private Date finishDate;
    @Basic(optional = false)
    @NotNull
    @Column(name = "FinishTime")
    @Temporal(TemporalType.TIME)
    private Date finishTime;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TaskType")
    private int taskType;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BatchID")
    private int batchID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "version")
    @Version
    private int version;

    public Task() {
    }

    public Task(Integer taskID) {
        this.taskID = taskID;
    }

    public Task(Integer taskID, String taskDesc, Date dueDate, Date dueTime, boolean highPriority, int taskDeptID, int finEID, Date finishDate, Date finishTime, int taskType, int batchID, int version) {
        this.taskID = taskID;
        this.taskDesc = taskDesc;
        this.dueDate = dueDate;
        this.dueTime = dueTime;
        this.highPriority = highPriority;
        this.taskDeptID = taskDeptID;
        this.finEID = finEID;
        this.finishDate = finishDate;
        this.finishTime = finishTime;
        this.taskType = taskType;
        this.batchID = batchID;
        this.version = version;
    }

    public Integer getTaskID() {
        return taskID;
    }

    public void setTaskID(Integer taskID) {
        this.taskID = taskID;
    }

    public String getTaskDesc() {
        return taskDesc;
    }

    public void setTaskDesc(String taskDesc) {
        this.taskDesc = taskDesc;
    }

    public Date getDueDate() {
        return dueDate;
    }

    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

    public Date getDueTime() {
        return dueTime;
    }

    public void setDueTime(Date dueTime) {
        this.dueTime = dueTime;
    }

    public boolean getHighPriority() {
        return highPriority;
    }

    public void setHighPriority(boolean highPriority) {
        this.highPriority = highPriority;
    }

    public int getTaskDeptID() {
        return taskDeptID;
    }

    public void setTaskDeptID(int taskDeptID) {
        this.taskDeptID = taskDeptID;
    }

    public int getFinEID() {
        return finEID;
    }

    public void setFinEID(int finEID) {
        this.finEID = finEID;
    }

    public Date getFinishDate() {
        return finishDate;
    }

    public void setFinishDate(Date finishDate) {
        this.finishDate = finishDate;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public int getTaskType() {
        return taskType;
    }

    public void setTaskType(int taskType) {
        this.taskType = taskType;
    }

    public int getBatchID() {
        return batchID;
    }

    public void setBatchID(int batchID) {
        this.batchID = batchID;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (taskID != null ? taskID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Task)) {
            return false;
        }
        Task other = (Task) object;
        if ((this.taskID == null && other.taskID != null) || (this.taskID != null && !this.taskID.equals(other.taskID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.Task[ taskID=" + taskID + " ]";
    }
    
}
